package executable.instance;

public class ObjectMethods {
    public static String toStringTest1() {
        return new ObjectMethods().toString();
    }

    public static String toStringTest2() {
        ObjectMethods objectMethodTest1 = new ObjectMethods();
        ObjectMethods objectMethodTest2 = new ObjectMethods();
        ObjectMethods objectMethodTest3 = new ObjectMethods();
        return objectMethodTest2.toString();
    }

    public static String toStringOnString() {
        String s = "this is my toString()";
        return s.toString();
    }

    public static int hashCodeTest() {
        final ObjectMethods tmp = new ObjectMethods();
        return new ObjectMethods().hashCode();
    }

    public static boolean equals1() {
        return new ObjectMethods().equals(new ObjectMethods());

    }

    public static boolean equals2() {
        final ObjectMethods obj = new ObjectMethods();
        final ObjectMethods obj2 = obj;
        return obj.equals(obj2);
    }

    public static boolean stringEquals1() {
        String x = "xxxxxxxxxasdasd";
        String y = "xxxxxxxxxasdasd";
        return x.equals(y);
    }

    public static boolean stringEquals2() {
        String x = "xxxxxxxxxasdasd";
        String y = "xxxxxxxxasdasd";
        return x.equals(y);
    }

    public static boolean referenceEquals1() {
        final ObjectMethods obj = new ObjectMethods();
        final ObjectMethods obj2 = obj;
        return obj == obj2;

    }

    public static boolean referenceEquals2() {
        final ObjectMethods obj = new ObjectMethods();
        final ObjectMethods obj2 = new ObjectMethods();
        return obj == obj2;
    }

    public static boolean referenceNotEquals() {
        final ObjectMethods obj = new ObjectMethods();
        final ObjectMethods obj2 = new ObjectMethods();
        return obj != obj2;
    }
}
